<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class TypeProf::RBS2JSON - typeprof: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-attr_method_def">#attr_method_def</a>
    <li ><a href="#method-i-attr_rbs_source">#attr_rbs_source</a>
    <li ><a href="#method-i-conv_block">#conv_block</a>
    <li ><a href="#method-i-conv_classes">#conv_classes</a>
    <li ><a href="#method-i-conv_constants">#conv_constants</a>
    <li ><a href="#method-i-conv_func">#conv_func</a>
    <li ><a href="#method-i-conv_globals">#conv_globals</a>
    <li ><a href="#method-i-conv_method_def">#conv_method_def</a>
    <li ><a href="#method-i-conv_type">#conv_type</a>
    <li ><a href="#method-i-conv_type_name">#conv_type_name</a>
    <li ><a href="#method-i-dump_json">#dump_json</a>
    <li ><a href="#method-i-each_class_decl">#each_class_decl</a>
    <li ><a href="#method-i-each_reference">#each_reference</a>
    <li ><a href="#method-i-get_super_class">#get_super_class</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-TypeProf::RBS2JSON">
    <h1 id="class-TypeProf::RBS2JSON" class="class">
      class TypeProf::RBS2JSON
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="AliasDecl">AliasDecl
          <dd>
          <dt id="TypeAlias">TypeAlias
          <dd>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(all_env, cur_env)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 128</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">all_env</span>, <span class="ruby-identifier">cur_env</span>)
  <span class="ruby-ivar">@all_env</span>, <span class="ruby-ivar">@cur_env</span> = <span class="ruby-identifier">all_env</span>, <span class="ruby-identifier">cur_env</span>
  <span class="ruby-ivar">@alias_resolution_stack</span> = {}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-attr_method_def" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attr_method_def</span><span
                                class="method-args">(kind, name, ty, visibility)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="attr_method_def-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 431</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attr_method_def</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">visibility</span>)
  {
    <span class="ruby-value">kind:</span> <span class="ruby-identifier">kind</span>,
    <span class="ruby-value">ivar:</span> <span class="ruby-identifier">name</span>,
    <span class="ruby-value">ty:</span> <span class="ruby-identifier">ty</span>,
    <span class="ruby-value">visibility:</span> <span class="ruby-identifier">visibility</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-attr_rbs_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attr_rbs_source</span><span
                                class="method-args">(member)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="attr_rbs_source-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 440</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attr_rbs_source</span>(<span class="ruby-identifier">member</span>)
  [
    <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>,
    <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">source</span>,
    [<span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">name</span>, <span class="ruby-constant">CodeRange</span>.<span class="ruby-identifier">from_rbs</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>)],
  ]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_block" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_block</span><span
                                class="method-args">(rbs_block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_block-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 448</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_block</span>(<span class="ruby-identifier">rbs_block</span>)
  <span class="ruby-identifier">blk</span> = <span class="ruby-identifier">rbs_block</span>.<span class="ruby-identifier">type</span>

  <span class="ruby-identifier">lead_tys</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">required_positionals</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>) }
  <span class="ruby-identifier">opt_tys</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">optional_positionals</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>) }
  <span class="ruby-identifier">rest_ty</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">rest_positionals</span>
  <span class="ruby-identifier">rest_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">rest_ty</span>.<span class="ruby-identifier">type</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">rest_ty</span>
  <span class="ruby-identifier">opt_kw_tys</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">optional_keywords</span>.<span class="ruby-identifier">to_h</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">type</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>)] }
  <span class="ruby-identifier">req_kw_tys</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">required_keywords</span>.<span class="ruby-identifier">to_h</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">type</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>)] }
  <span class="ruby-identifier">rest_kw_ty</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">rest_keywords</span>
  <span class="ruby-identifier">rest_kw_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">rest_kw_ty</span>.<span class="ruby-identifier">type</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">rest_kw_ty</span>

  <span class="ruby-identifier">ret_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">blk</span>.<span class="ruby-identifier">return_type</span>)

  {
    <span class="ruby-value">required_block:</span> <span class="ruby-identifier">rbs_block</span>.<span class="ruby-identifier">required</span>,
    <span class="ruby-value">lead_tys:</span> <span class="ruby-identifier">lead_tys</span>,
    <span class="ruby-value">opt_tys:</span> <span class="ruby-identifier">opt_tys</span>,
    <span class="ruby-value">rest_ty:</span> <span class="ruby-identifier">rest_ty</span>,
    <span class="ruby-value">req_kw_tys:</span> <span class="ruby-identifier">req_kw_tys</span>,
    <span class="ruby-value">opt_kw_tys:</span> <span class="ruby-identifier">opt_kw_tys</span>,
    <span class="ruby-value">rest_kw_ty:</span> <span class="ruby-identifier">rest_kw_ty</span>,
    <span class="ruby-value">blk:</span> <span class="ruby-identifier">blk</span>,
    <span class="ruby-value">ret_ty:</span> <span class="ruby-identifier">ret_ty</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_classes" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_classes</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_classes-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 168</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_classes</span>
  <span class="ruby-identifier">json</span> = {}

  <span class="ruby-identifier">each_class_decl</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">decls</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-identifier">super_class_name</span>, <span class="ruby-identifier">super_class_args</span> = <span class="ruby-identifier">get_super_class</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decls</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">super_class_name</span>
      <span class="ruby-identifier">name</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">super_class_name</span>)
      <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">super_class_args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>) }
      <span class="ruby-identifier">superclass</span> = [<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type_args</span>]
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">type_params</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">modules</span> = { <span class="ruby-value">include:</span> [], <span class="ruby-value">extend:</span> [], <span class="ruby-value">prepend:</span> [] }
    <span class="ruby-identifier">methods</span> = {}
    <span class="ruby-identifier">attr_methods</span> = {}
    <span class="ruby-identifier">ivars</span> = {}
    <span class="ruby-identifier">cvars</span> = {}
    <span class="ruby-identifier">rbs_sources</span> = {}
    <span class="ruby-identifier">visibility</span> = <span class="ruby-keyword">true</span>

    <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>

      <span class="ruby-identifier">type_params2</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type_params</span>
      <span class="ruby-comment"># A hack to deal with the imcompatibility between rbs 1.8 and 2.0</span>
      <span class="ruby-identifier">type_params2</span> = <span class="ruby-identifier">type_params2</span>.<span class="ruby-identifier">params</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_params2</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:params</span>)
      <span class="ruby-identifier">type_params2</span> = <span class="ruby-identifier">type_params2</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">param</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">param</span>.<span class="ruby-identifier">variance</span>] }
      <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;inconsistent type parameter declaration&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_params</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">type_params</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">type_params2</span>
      <span class="ruby-identifier">type_params</span> = <span class="ruby-identifier">type_params2</span>

      <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">member</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodDefinition</span>
          <span class="ruby-identifier">name</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>

          <span class="ruby-keyword">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:overloads</span>)
            <span class="ruby-identifier">types</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">overloads</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">overload</span><span class="ruby-operator">|</span> <span class="ruby-identifier">overload</span>.<span class="ruby-identifier">method_type</span> }
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">types</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">types</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">method_types</span> = <span class="ruby-identifier">types</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method_type</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">case</span> <span class="ruby-identifier">method_type</span>
            <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodType</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">method_type</span>
            <span class="ruby-keyword">when</span> <span class="ruby-value">:super</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">end</span>

          <span class="ruby-identifier">method_def</span> = <span class="ruby-identifier">conv_method_def</span>(<span class="ruby-identifier">method_types</span>, <span class="ruby-identifier">visibility</span>)
          <span class="ruby-identifier">rbs_source</span> = [
            (<span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:singleton</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;self.&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>,
            <span class="ruby-identifier">types</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">source</span> },
            [<span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">name</span>, <span class="ruby-constant">CodeRange</span>.<span class="ruby-identifier">from_rbs</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>)],
          ]
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">instance?</span>
            <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">method_def</span>
            <span class="ruby-identifier">rbs_sources</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">rbs_source</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">singleton?</span>
            <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">true</span>, <span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">method_def</span>
            <span class="ruby-identifier">rbs_sources</span>[[<span class="ruby-keyword">true</span>, <span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">rbs_source</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>
          <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>)
          <span class="ruby-identifier">attr_methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_method_def</span>(<span class="ruby-value">:reader</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">visibility</span>)
          <span class="ruby-identifier">rbs_sources</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_rbs_source</span>(<span class="ruby-identifier">member</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>
          <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>)
          <span class="ruby-identifier">attr_methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_method_def</span>(<span class="ruby-value">:writer</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">visibility</span>)
          <span class="ruby-identifier">rbs_sources</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_rbs_source</span>(<span class="ruby-identifier">member</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>
          <span class="ruby-identifier">ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>)
          <span class="ruby-identifier">attr_methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_method_def</span>(<span class="ruby-value">:accessor</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-identifier">visibility</span>)
          <span class="ruby-identifier">rbs_sources</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>]] = <span class="ruby-identifier">attr_rbs_source</span>(<span class="ruby-identifier">member</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Alias</span>
          <span class="ruby-comment"># XXX: an alias to attr methods?</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">instance?</span>
            <span class="ruby-identifier">method_def</span> = <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">old_name</span>]]
            <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">false</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">new_name</span>]] = <span class="ruby-identifier">method_def</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_def</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">singleton?</span>
            <span class="ruby-identifier">method_def</span> = <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">true</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">old_name</span>]]
            <span class="ruby-identifier">methods</span>[[<span class="ruby-keyword">true</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">new_name</span>]] = <span class="ruby-identifier">method_def</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">method_def</span>
          <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Include</span>
          <span class="ruby-identifier">name</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:class</span>
            <span class="ruby-comment"># including a module</span>
            <span class="ruby-identifier">mod</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
            <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>) }
            <span class="ruby-identifier">modules</span>[<span class="ruby-value">:include</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">type_args</span>]
          <span class="ruby-keyword">else</span>
            <span class="ruby-comment"># including an interface</span>
            <span class="ruby-identifier">mod</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
            <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>) }
            <span class="ruby-identifier">modules</span>[<span class="ruby-value">:include</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">type_args</span>]
          <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Extend</span>
          <span class="ruby-identifier">name</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:class</span>
            <span class="ruby-identifier">mod</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
            <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>) }
            <span class="ruby-identifier">modules</span>[<span class="ruby-value">:extend</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">type_args</span>]
          <span class="ruby-keyword">else</span>
            <span class="ruby-comment"># extending a module with an interface is not supported yet</span>
          <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Prepend</span>
          <span class="ruby-identifier">name</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value">:class</span>
            <span class="ruby-identifier">mod</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
            <span class="ruby-identifier">type_args</span> = <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>) }
            <span class="ruby-identifier">modules</span>[<span class="ruby-value">:prepend</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">type_args</span>]
          <span class="ruby-keyword">else</span>
            <span class="ruby-comment"># extending a module with an interface is not supported yet</span>
          <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceVariable</span>
          <span class="ruby-identifier">ivars</span>[<span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassVariable</span>
          <span class="ruby-identifier">cvars</span>[<span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>)

        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Public</span>
          <span class="ruby-identifier">visibility</span> = <span class="ruby-keyword">true</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Private</span>
          <span class="ruby-identifier">visibility</span> = <span class="ruby-keyword">false</span>

        <span class="ruby-comment"># The following declarations are ignoreable because they are handled in other level</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Constant</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">AliasDecl</span> <span class="ruby-comment"># type alias</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>, <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">TypeAlias</span>

        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Importing #{ member.class.name } is not supported yet&quot;</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">json</span>[<span class="ruby-identifier">klass</span>] = {
      <span class="ruby-value">type_params:</span> <span class="ruby-identifier">type_params</span>,
      <span class="ruby-value">superclass:</span> <span class="ruby-identifier">superclass</span>,
      <span class="ruby-value">members:</span> {
        <span class="ruby-value">modules:</span> <span class="ruby-identifier">modules</span>,
        <span class="ruby-value">methods:</span> <span class="ruby-identifier">methods</span>,
        <span class="ruby-value">attr_methods:</span> <span class="ruby-identifier">attr_methods</span>,
        <span class="ruby-value">ivars:</span> <span class="ruby-identifier">ivars</span>,
        <span class="ruby-value">cvars:</span> <span class="ruby-identifier">cvars</span>,
        <span class="ruby-value">rbs_sources:</span> <span class="ruby-identifier">rbs_sources</span>,
      },
    }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">json</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_constants" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_constants</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>constant_name = [Symbol]</p>

<p>{ constant_name =&gt; type }</p>

                              <div class="method-source-code" id="conv_constants-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 144</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_constants</span>
  <span class="ruby-identifier">constants</span> = {}
  <span class="ruby-ivar">@cur_env</span>.<span class="ruby-identifier">constant_decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-identifier">constants</span>[<span class="ruby-identifier">klass</span>] = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">constants</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_func" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_func</span><span
                                class="method-args">(type_params, func, block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_func-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 404</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_func</span>(<span class="ruby-identifier">type_params</span>, <span class="ruby-identifier">func</span>, <span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">blk</span> = <span class="ruby-identifier">block</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">conv_block</span>(<span class="ruby-identifier">block</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">lead_tys</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">required_positionals</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>) }
  <span class="ruby-identifier">opt_tys</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">optional_positionals</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>) }
  <span class="ruby-identifier">rest_ty</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">rest_positionals</span>
  <span class="ruby-identifier">rest_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">rest_ty</span>.<span class="ruby-identifier">type</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">rest_ty</span>
  <span class="ruby-identifier">opt_kw_tys</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">optional_keywords</span>.<span class="ruby-identifier">to_h</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">type</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>)] }
  <span class="ruby-identifier">req_kw_tys</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">required_keywords</span>.<span class="ruby-identifier">to_h</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">type</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">type</span>)] }
  <span class="ruby-identifier">rest_kw_ty</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">rest_keywords</span>
  <span class="ruby-identifier">rest_kw_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">rest_kw_ty</span>.<span class="ruby-identifier">type</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">rest_kw_ty</span>

  <span class="ruby-identifier">ret_ty</span> = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">func</span>.<span class="ruby-identifier">return_type</span>)

  {
    <span class="ruby-value">type_params:</span> <span class="ruby-identifier">type_params</span>,
    <span class="ruby-value">lead_tys:</span> <span class="ruby-identifier">lead_tys</span>,
    <span class="ruby-value">opt_tys:</span> <span class="ruby-identifier">opt_tys</span>,
    <span class="ruby-value">rest_ty:</span> <span class="ruby-identifier">rest_ty</span>,
    <span class="ruby-value">req_kw_tys:</span> <span class="ruby-identifier">req_kw_tys</span>,
    <span class="ruby-value">opt_kw_tys:</span> <span class="ruby-identifier">opt_kw_tys</span>,
    <span class="ruby-value">rest_kw_ty:</span> <span class="ruby-identifier">rest_kw_ty</span>,
    <span class="ruby-value">blk:</span> <span class="ruby-identifier">blk</span>,
    <span class="ruby-value">ret_ty:</span> <span class="ruby-identifier">ret_ty</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_globals" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_globals</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>gvar_name = Symbol (:$gvar)</p>

<p>{ gvar_name =&gt; type }</p>

                              <div class="method-source-code" id="conv_globals-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 156</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_globals</span>
  <span class="ruby-identifier">gvars</span> = {}
  <span class="ruby-ivar">@cur_env</span>.<span class="ruby-identifier">global_decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>
    <span class="ruby-identifier">gvars</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">gvars</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_method_def" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_method_def</span><span
                                class="method-args">(rbs_method_types, visibility)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_method_def-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 394</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_method_def</span>(<span class="ruby-identifier">rbs_method_types</span>, <span class="ruby-identifier">visibility</span>)
  <span class="ruby-identifier">sig_rets</span> = <span class="ruby-identifier">rbs_method_types</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method_type</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">conv_func</span>(<span class="ruby-identifier">method_type</span>.<span class="ruby-identifier">type_params</span>, <span class="ruby-identifier">method_type</span>.<span class="ruby-identifier">type</span>, <span class="ruby-identifier">method_type</span>.<span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">end</span>
  {
    <span class="ruby-value">sig_rets:</span> <span class="ruby-identifier">sig_rets</span>,
    <span class="ruby-value">visibility:</span> <span class="ruby-identifier">visibility</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_type</span><span
                                class="method-args">(ty)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_type-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 475</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_type</span>(<span class="ruby-identifier">ty</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">ty</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassSingleton</span>
    [<span class="ruby-value">:class</span>, <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>)]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassInstance</span>
    <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">klass</span>
    <span class="ruby-keyword">when</span> [<span class="ruby-value">:Array</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">1</span>
      [<span class="ruby-value">:array</span>, [<span class="ruby-value">:Array</span>], [], <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>)]
    <span class="ruby-keyword">when</span> [<span class="ruby-value">:Hash</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">2</span>
      <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span> = <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>
      [<span class="ruby-value">:hash</span>, [<span class="ruby-value">:Hash</span>], [<span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">key</span>), <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">val</span>)]]
    <span class="ruby-keyword">when</span> [<span class="ruby-value">:Enumerator</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">2</span>
      [<span class="ruby-value">:array</span>, [<span class="ruby-value">:Enumerator</span>], [], <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>)]
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
        [<span class="ruby-value">:instance</span>, <span class="ruby-identifier">klass</span>]
      <span class="ruby-keyword">else</span>
        [<span class="ruby-value">:cell</span>, [<span class="ruby-value">:instance</span>, <span class="ruby-identifier">klass</span>], <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ty</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty</span>) }]
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Bool</span>   <span class="ruby-keyword">then</span> [<span class="ruby-value">:bool</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Any</span>    <span class="ruby-keyword">then</span> [<span class="ruby-value">:any</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Top</span>    <span class="ruby-keyword">then</span> [<span class="ruby-value">:any</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Void</span>   <span class="ruby-keyword">then</span> [<span class="ruby-value">:void</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Self</span>   <span class="ruby-keyword">then</span> [<span class="ruby-value">:self</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Nil</span>    <span class="ruby-keyword">then</span> [<span class="ruby-value">:nil</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Bottom</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:union</span>, []]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Variable</span>      <span class="ruby-keyword">then</span> [<span class="ruby-value">:var</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Tuple</span>
    <span class="ruby-identifier">tys</span> = <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">types</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ty2</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty2</span>) }
    [<span class="ruby-value">:array</span>, [<span class="ruby-value">:Array</span>], <span class="ruby-identifier">tys</span>, [<span class="ruby-value">:union</span>, []]]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Literal</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">literal</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Integer</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:int</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>  <span class="ruby-keyword">then</span> [<span class="ruby-value">:str</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>    <span class="ruby-keyword">then</span> [<span class="ruby-value">:true</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>   <span class="ruby-keyword">then</span> [<span class="ruby-value">:false</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Symbol</span>  <span class="ruby-keyword">then</span> [<span class="ruby-value">:sym</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">literal</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">p</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">literal</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Alias</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@alias_resolution_stack</span>[<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>]
      [<span class="ruby-value">:any</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">begin</span>
        <span class="ruby-ivar">@alias_resolution_stack</span>[<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">alias_decl</span> = (<span class="ruby-ivar">@all_env</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:alias_decls</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@all_env</span>.<span class="ruby-identifier">alias_decls</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@all_env</span>.<span class="ruby-identifier">type_alias_decls</span>)[<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>]
        <span class="ruby-identifier">alias_decl</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">alias_decl</span>.<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>) <span class="ruby-operator">:</span> [<span class="ruby-value">:any</span>]
      <span class="ruby-keyword">ensure</span>
        <span class="ruby-ivar">@alias_resolution_stack</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Union</span>
    [<span class="ruby-value">:union</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">types</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ty2</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty2</span>) }.<span class="ruby-identifier">compact</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Intersection</span>
    [<span class="ruby-value">:intersection</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">types</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">ty2</span><span class="ruby-operator">|</span> <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty2</span>) }.<span class="ruby-identifier">compact</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Optional</span>
    [<span class="ruby-value">:optional</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">type</span>)]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>
    <span class="ruby-comment"># XXX: Currently, only a few builtin interfaces are supported</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">to_s</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;::_ToS&quot;</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:str</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;::_ToStr&quot;</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:str</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;::_ToInt&quot;</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:int</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;::_ToAry[U]&quot;</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:array</span>, [<span class="ruby-value">:Array</span>], [], [<span class="ruby-value">:var</span>, <span class="ruby-value">:U</span>]]
    <span class="ruby-keyword">else</span>
      [<span class="ruby-value">:instance</span>, <span class="ruby-identifier">conv_type_name</span>(<span class="ruby-identifier">ty</span>.<span class="ruby-identifier">name</span>)]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Instance</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:any</span>] <span class="ruby-comment"># XXX: not implemented yet</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Bases</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span> <span class="ruby-keyword">then</span> [<span class="ruby-value">:any</span>] <span class="ruby-comment"># XXX: not implemented yet</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Record</span>
    [<span class="ruby-value">:hash_record</span>, [<span class="ruby-value">:Hash</span>], <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">fields</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">ty</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">conv_type</span>(<span class="ruby-identifier">ty</span>)] }]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span><span class="ruby-operator">::</span><span class="ruby-constant">Proc</span>
    [<span class="ruby-value">:proc</span>, <span class="ruby-identifier">conv_func</span>(<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword">nil</span>)]
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;unknown RBS type: %p&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">ty</span>.<span class="ruby-identifier">class</span>
    [<span class="ruby-value">:any</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-conv_type_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">conv_type_name</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="conv_type_name-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 561</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">conv_type_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">name</span>.<span class="ruby-identifier">name</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dump_json" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dump_json</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dump_json-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 133</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dump_json</span>
  {
    <span class="ruby-value">classes:</span> <span class="ruby-identifier">conv_classes</span>,
    <span class="ruby-value">constants:</span> <span class="ruby-identifier">conv_constants</span>,
    <span class="ruby-value">globals:</span> <span class="ruby-identifier">conv_globals</span>,
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-each_class_decl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">each_class_decl</span><span
                                class="method-args">() { |name, decls| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="each_class_decl-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 327</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each_class_decl</span>
  <span class="ruby-comment"># topological sort</span>
  <span class="ruby-comment">#   * superclasses and modules appear earlier than their subclasses (Object is earlier than String)</span>
  <span class="ruby-comment">#   * namespace module appers earlier than its children (Process is earlier than Process::Status)</span>
  <span class="ruby-identifier">visited</span> = {}
  <span class="ruby-identifier">queue</span> = <span class="ruby-ivar">@cur_env</span>.<span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> [<span class="ruby-value">:visit</span>, <span class="ruby-identifier">name</span>] }.<span class="ruby-identifier">reverse</span>
  <span class="ruby-keyword">until</span> <span class="ruby-identifier">queue</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">event</span>, <span class="ruby-identifier">name</span> = <span class="ruby-identifier">queue</span>.<span class="ruby-identifier">pop</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">event</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:visit</span>
      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">visited</span>[<span class="ruby-identifier">name</span>]
        <span class="ruby-identifier">visited</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">queue</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-value">:new</span>, <span class="ruby-identifier">name</span>]
        <span class="ruby-ivar">@all_env</span>.<span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>
          <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>)
          <span class="ruby-identifier">each_reference</span>(<span class="ruby-identifier">decl</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">queue</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-value">:visit</span>, <span class="ruby-identifier">name</span>] }
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">queue</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-value">:visit</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">to_type_name</span>] <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:new</span>
      <span class="ruby-identifier">decls</span> = <span class="ruby-ivar">@cur_env</span>.<span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>]
      <span class="ruby-keyword">yield</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">decls</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">decls</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@cur_env</span>.<span class="ruby-identifier">interface_decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">yield</span> <span class="ruby-identifier">name</span>, [<span class="ruby-identifier">decl</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-each_reference" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">each_reference</span><span
                                class="method-args">(decl) { |name| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="each_reference-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 358</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each_reference</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
  <span class="ruby-keyword">yield</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">super_class</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">BuiltinNames</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">BuiltinNames</span><span class="ruby-operator">::</span><span class="ruby-constant">BasicObject</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span>
  <span class="ruby-identifier">decls</span> = <span class="ruby-ivar">@all_env</span>.<span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">decls</span>
    <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">each_reference</span>(<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_super_class" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_super_class</span><span
                                class="method-args">(name, decls)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="get_super_class-source">
            <pre><span class="ruby-comment"># File typeprof-0.21.8/lib/typeprof/import.rb, line 375</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_super_class</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decls</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">BuiltinNames</span><span class="ruby-operator">::</span><span class="ruby-constant">BasicObject</span>.<span class="ruby-identifier">name</span>

  <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>
      <span class="ruby-identifier">super_class</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">super_class</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">args</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">super_class</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>, <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;unknown declaration: %p&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">class</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">BuiltinNames</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">name</span>, []
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

